package cn.com.b2office.domain;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Shopping Cart
 * 
 * @author wangtao.upc@gmail.com
 * 
 */
public class Cart implements Serializable {

	private static final long serialVersionUID = -508249111682951569L;

	/**
	 * Member's Id
	 */
	private String memberId = null;

	/**
	 * 开始购物时间
	 */
	private long shoppingTime = 0L;

	/**
	 * 收货地址ID
	 */
	private String addressId = null;

	/**
	 * 配送方式
	 */
	private int deliveryMode = 0;

	/**
	 * 支付方式
	 */
	private int payMode = 0;

	/**
	 * 是否开发票，0不开，1开
	 */
	private int invoiced = 0;

	/**
	 * 发票抬头
	 */
	private String invoiceTitle = null;

	/**
	 * 发票类型
	 */
	private int invoiceKind = 0;

	/**
	 * 前台用户选择是否按最快配送拆分订单 0不可以；1可以拆分订单
	 */
	private int split = 1;

	/** 是否享受打折优惠 */
	private int enableDiscount = 0;

	/**
	 * 备注
	 */
	private String comments = null;

	/**
	 * used to generate CartItem.Id
	 */
	private int cartItemId_sequence = 1;

	/**
	 * 购物车里的商品，按不同的配送时间短分开
	 */
	private Map<SendDate, List<CartItem>> cartItems = null;

	/**
	 * 购物车金额
	 */
	private double sum = 0.0;

	/**
	 * 配送费
	 */
	private double freight = 0.0;

	/**
	 * 购物车商品数目
	 */
	private int cartSize = 0;

	public String getAddressId() {
		return addressId;
	}

	public void setAddressId(String addressId) {
		this.addressId = addressId;
	}

	public Map<SendDate, List<CartItem>> getCartItems() {
		return cartItems;
	}

	public void setCartItems(Map<SendDate, List<CartItem>> cartItems) {
		this.cartItems = cartItems;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public int getDeliveryMode() {
		return deliveryMode;
	}

	public void setDeliveryMode(int deliveryMode) {
		this.deliveryMode = deliveryMode;
	}

	public int getEnableDiscount() {
		return enableDiscount;
	}

	public void setEnableDiscount(int enableDiscount) {
		this.enableDiscount = enableDiscount;
	}

	public int getInvoiced() {
		return invoiced;
	}

	public void setInvoiced(int invoiced) {
		this.invoiced = invoiced;
	}

	public int getInvoiceKind() {
		return invoiceKind;
	}

	public void setInvoiceKind(int invoiceKind) {
		this.invoiceKind = invoiceKind;
	}

	public String getInvoiceTitle() {
		return invoiceTitle;
	}

	public void setInvoiceTitle(String invoiceTitle) {
		this.invoiceTitle = invoiceTitle;
	}

	public String getMemberId() {
		return memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	public int getPayMode() {
		return payMode;
	}

	public void setPayMode(int payMode) {
		this.payMode = payMode;
	}

	public long getShoppingTime() {
		return shoppingTime;
	}

	public void setShoppingTime(long shoppingTime) {
		this.shoppingTime = shoppingTime;
	}

	public int getSplit() {
		return split;
	}

	public void setSplit(int split) {
		this.split = split;
	}

	public double getSum() {
		return sum;
	}

	public void setSum(double sum) {
		this.sum = sum;
	}

	public int getCartSize() {
		return cartSize;
	}

	public void setCartSize(int cartSize) {
		this.cartSize = cartSize;
	}

	public double getFreight() {
		return freight;
	}

	public void setFreight(double freight) {
		this.freight = freight;
	}

	/**
	 * return the current value and increase
	 * 
	 * @return
	 */
	public int getCartItemId_sequence() {
		return cartItemId_sequence++;
	}

}
